home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 December / maximum-cd-2009-12.iso / DiscContents / gimp-2.7.0-i686-setup.exe / {app} / share / gimp / 2.0 / scripts / alien-glow-bullet.scm < prev    next >
Encoding:
Text File  |  2009-08-19  |  3.9 KB  |  109 lines

  1. ; GIMP - The GNU Image Manipulation Program
  2. ; Copyright (C) 1995 Spencer Kimball and Peter Mattis
  3. ;
  4. ; Alien Glow themed bullets for web pages
  5. ; Copyright (c) 1997 Adrian Likins
  6. ; aklikins@eos.ncsu.edu
  7. ;
  8. ; This program is free software: you can redistribute it and/or modify
  9. ; it under the terms of the GNU General Public License as published by
  10. ; the Free Software Foundation; either version 3 of the License, or
  11. ; (at your option) any later version.
  12. ;
  13. ; This program is distributed in the hope that it will be useful,
  14. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. ; GNU General Public License for more details.
  17. ;
  18. ; You should have received a copy of the GNU General Public License
  19. ; along with this program.  If not, see <http://www.gnu.org/licenses/>.
  20.  
  21. (define (script-fu-alien-glow-bullet radius
  22.                                      glow-color
  23.                                      bg-color
  24.                                      flatten)
  25.  
  26.   (define (center-ellipse img cx cy rx ry op aa feather frad)
  27.     (gimp-ellipse-select img (- cx rx) (- cy ry) (+ rx rx) (+ ry ry)
  28.                          op aa feather frad)
  29.   )
  30.  
  31.  
  32.   (let* (
  33.         (img (car (gimp-image-new radius radius RGB)))
  34.         (border (/ radius 4))
  35.         (diameter (* radius 2))
  36.         (half-radius (/ radius 2))
  37.         (blend-start (+ half-radius (/ half-radius 2)))
  38.         (bullet-layer (car (gimp-layer-new img
  39.                                            diameter diameter RGBA-IMAGE
  40.                                            "Ruler" 100 NORMAL-MODE)))
  41.         (glow-layer (car (gimp-layer-new img diameter diameter RGBA-IMAGE
  42.                                          "ALien Glow" 100 NORMAL-MODE)))
  43.         (bg-layer (car (gimp-layer-new img diameter diameter RGB-IMAGE
  44.                                        "Background" 100 NORMAL-MODE)))
  45.         )
  46.  
  47.     (gimp-context-push)
  48.  
  49.     (gimp-image-undo-disable img)
  50.     (gimp-image-resize img diameter diameter 0 0)
  51.     (gimp-image-add-layer img bg-layer 1)
  52.     (gimp-image-add-layer img glow-layer -1)
  53.     (gimp-image-add-layer img bullet-layer -1)
  54.  
  55.     ; (gimp-layer-set-lock-alpha ruler-layer TRUE)
  56.     (gimp-context-set-background bg-color)
  57.     (gimp-edit-fill bg-layer BACKGROUND-FILL)
  58.     (gimp-edit-clear glow-layer)
  59.     (gimp-edit-clear bullet-layer)
  60.  
  61.     (center-ellipse img radius radius half-radius half-radius
  62.                     CHANNEL-OP-REPLACE TRUE FALSE 0)
  63.  
  64.     ; (gimp-rect-select img (/ height 2) (/ height 2) length height CHANNEL-OP-REPLACE FALSE 0)
  65.     (gimp-context-set-foreground '(90 90 90))
  66.     (gimp-context-set-background '(0 0 0))
  67.  
  68.     (gimp-edit-blend bullet-layer FG-BG-RGB-MODE NORMAL-MODE
  69.                      GRADIENT-RADIAL 100 0 REPEAT-NONE FALSE
  70.                      FALSE 0 0 TRUE
  71.                      blend-start blend-start
  72.                      (+ half-radius radius) (+ half-radius radius))
  73.  
  74.     (gimp-context-set-foreground glow-color)
  75.     (gimp-selection-grow img border)
  76.     (gimp-selection-feather img  border)
  77.     (gimp-edit-fill glow-layer FOREGROUND-FILL)
  78.     (gimp-selection-none img)
  79.     (if (>= radius 16)
  80.         (plug-in-gauss-rle RUN-NONINTERACTIVE img glow-layer 25 TRUE TRUE)
  81.         (plug-in-gauss-rle RUN-NONINTERACTIVE img glow-layer 12 TRUE TRUE)
  82.     )
  83.  
  84.     (if (= flatten TRUE)
  85.         (gimp-image-flatten img)
  86.     )
  87.     (gimp-image-undo-enable img)
  88.     (gimp-display-new img)
  89.  
  90.     (gimp-context-pop)
  91.   )
  92. )
  93.  
  94. (script-fu-register "script-fu-alien-glow-bullet"
  95.   _"_Bullet..."
  96.   _"Create a bullet graphic with an eerie glow for web pages"
  97.   "Adrian Likins"
  98.   "Adrian Likins"
  99.   "1997"
  100.   ""
  101.   SF-ADJUSTMENT _"Radius"           '(16 1 100 1 10 0 1)
  102.   SF-COLOR      _"Glow color"       '(63 252 0)
  103.   SF-COLOR      _"Background color" "black"
  104.   SF-TOGGLE     _"Flatten image"    TRUE
  105. )
  106.  
  107. (script-fu-menu-register "script-fu-alien-glow-bullet"
  108.                          "<Image>/File/Create/Web Page Themes/Alien Glow")
  109.